package com.luyou.a07;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.InitializingBean;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

/**
 * 销毁执行顺序依次是@PreDestroy 、DisposableBean
 * @author 28336
 * @version 1.0
 * Create by 2023/12/25 8:34
 */
@Slf4j
public class Bean2 implements DisposableBean {

    @PreDestroy
    public void destroy1(){
        log.info("销毁1");
    }

    @Override
    public void destroy() throws Exception {
        log.info("销毁2");
    }

    public void destroy3(){
        log.info("销毁3");
    }
}
